/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.openbookformat.tags;

/**
 *
 * @author MUFEED
 */

    public enum TagType {
        BF,
        COMPOSITE,
        HEADING,
        FORMAT,
        FOOTNOTE,
        FN,
        FN_MARK,
        MBOX,
        PAR,
        PAGEBREAK,
        POET,
        RHYME,
        TEXT,
        TOC_TEXT,
        SUPER_SCRIPT,
        SUB_SCRIPT,
        VERSE;

        public TagType getTagType(Tag tag) {
            if (tag instanceof Text)
                return TagType.TEXT;
            if (tag instanceof FnMarkTag)
                return TagType.FN_MARK;
            if (tag instanceof FootnoteTag)
                return TagType.FOOTNOTE;
            if (tag instanceof PagebreakTag)
                return TagType.PAGEBREAK;


           return TagType.valueOf(tag.getClass().getSimpleName().substring(
                    0, tag.getClass().getSimpleName().indexOf("Tag")).toUpperCase());
        }
    }
